from rest_framework import serializers

from doctor.models import Doctoc


class DoctorInfoSerializer(serializers.ModelSerializer):
    class Meta:
        model = Doctoc
        fields = '__all__'


from .search_indexes import DoctocIndex
from drf_haystack.serializers import HaystackSerializer


class DoctorIndexSerializer(HaystackSerializer):
    """
    SKU索引结果数据序列化器
    """

    class Meta:
        index_classes = [DoctocIndex]
        fields = ('text', 'id', 'name', 'hospitalname', 'subject', 'hospital')
